@rama_nigg/open-cursor 2.4.2 → 2.4.4

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/dist/index.js CHANGED
@@ -13796,7 +13796,7 @@ ${output}`);
13796
13796
  if (include) {
13797
13797
  grepArgs.push(`--include=${include}`);
13798
13798
  }
13799
- grepArgs.push(pattern, path2);
13799
+ grepArgs.push("-e", pattern, path2);
13800
13800
  const runGrep = async (extraArgs = []) => {
13801
13801
  return execFileAsync("grep", [...extraArgs, ...grepArgs], { timeout: 30000 });
13802
13802
  };
@@ -14563,8 +14563,8 @@ function normalizeToolSpecificArgs(toolName, args) {
14563
14563
  if (!hasStringNew && typeof content === "string") {
14564
14564
  repaired.new_string = content;
14565
14565
  }
14566
- if (typeof repaired.new_string === "string" && !hasStringOld) {
14567
- repaired.old_string = "";
14566
+ if (hasStringOld && repaired.old_string === "") {
14567
+ delete repaired.old_string;
14568
14568
  }
14569
14569
  return repaired;
14570
14570
  }
@@ -14867,15 +14867,7 @@ async function handleToolLoopEventLegacy(options) {
14867
14867
  }
14868
14868
  return { intercepted: false, skipConverter: true, terminate: validationTermination };
14869
14869
  }
14870
- const reroutedWrite = tryRerouteEditToWrite(normalizedToolCall, compat.normalizedArgs, allowedToolNames, toolSchemaMap);
14871
- if (reroutedWrite) {
14872
- log18.debug("Rerouting malformed edit call to write (legacy)", {
14873
- path: reroutedWrite.path,
14874
- missing: compat.validation.missing,
14875
- typeErrors: compat.validation.typeErrors
14876
- });
14877
- normalizedToolCall = reroutedWrite.toolCall;
14878
- } else if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
14870
+ if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
14879
14871
  const hintChunk = createNonFatalSchemaValidationHintChunk(responseMeta, normalizedToolCall, compat.validation);
14880
14872
  log18.debug("Emitting non-fatal schema validation hint in legacy and skipping malformed tool execution", {
14881
14873
  tool: normalizedToolCall.function.name,
@@ -15019,19 +15011,6 @@ async function handleToolLoopEventV1(options) {
15019
15011
  }
15020
15012
  return { intercepted: false, skipConverter: true, terminate: termination2 };
15021
15013
  }
15022
- const reroutedWrite = tryRerouteEditToWrite(normalizedToolCall, compat.normalizedArgs, allowedToolNames, toolSchemaMap);
15023
- if (reroutedWrite) {
15024
- log18.debug("Rerouting malformed edit call to write", {
15025
- path: reroutedWrite.path,
15026
- missing: compat.validation.missing,
15027
- typeErrors: compat.validation.typeErrors
15028
- });
15029
- await onInterceptedToolCall(reroutedWrite.toolCall);
15030
- return {
15031
- intercepted: true,
15032
- skipConverter: true
15033
- };
15034
- }
15035
15014
  if (schemaValidationFailureMode === "pass_through" && shouldTerminateOnSchemaValidation(normalizedToolCall, compat.validation)) {
15036
15015
  return {
15037
15016
  intercepted: false,
@@ -15341,36 +15320,6 @@ function shouldUsePassThroughForEditSchema(event) {
15341
15320
  const normalizedName = rawName.endsWith("ToolCall") ? rawName.slice(0, -"ToolCall".length) : rawName;
15342
15321
  return normalizedName.toLowerCase() === "edit";
15343
15322
  }
15344
- function tryRerouteEditToWrite(toolCall, normalizedArgs, allowedToolNames, toolSchemaMap) {
15345
- if (toolCall.function.name.toLowerCase() !== "edit") {
15346
- return null;
15347
- }
15348
- if (!allowedToolNames.has("write") || !toolSchemaMap.has("write")) {
15349
- return null;
15350
- }
15351
- const path2 = typeof normalizedArgs.path === "string" && normalizedArgs.path.length > 0 ? normalizedArgs.path : null;
15352
- if (!path2) {
15353
- return null;
15354
- }
15355
- const content = typeof normalizedArgs.new_string === "string" ? normalizedArgs.new_string : typeof normalizedArgs.content === "string" ? normalizedArgs.content : null;
15356
- if (content === null) {
15357
- return null;
15358
- }
15359
- const oldString = normalizedArgs.old_string;
15360
- if (typeof oldString === "string" && oldString.length > 0) {
15361
- return null;
15362
- }
15363
- return {
15364
- path: path2,
15365
- toolCall: {
15366
- ...toolCall,
15367
- function: {
15368
- name: "write",
15369
- arguments: JSON.stringify({ path: path2, content })
15370
- }
15371
- }
15372
- };
15373
- }
15374
15323
  function isRecord4(value) {
15375
15324
  return typeof value === "object" && value !== null && !Array.isArray(value);
15376
15325
  }
@@ -17398,6 +17347,8 @@ function buildToolHookEntries(registry, fallbackBaseDir) {
17398
17347
  const sessionWorkspaceBySession = new Map;
17399
17348
  const tools = registry.list();
17400
17349
  for (const t of tools) {
17350
+ if (NATIVE_TOOL_HOOK_EXCLUSIONS.has(t.name))
17351
+ continue;
17401
17352
  const handler = registry.getHandler(t.name);
17402
17353
  if (!handler)
17403
17354
  continue;
@@ -17422,7 +17373,7 @@ function buildToolHookEntries(registry, fallbackBaseDir) {
17422
17373
  }
17423
17374
  return entries;
17424
17375
  }
17425
- var log20, DEBUG_LOG_DIR2, DEBUG_LOG_FILE2, CURSOR_PROVIDER_ID2 = "cursor-acp", CURSOR_PROVIDER_PREFIX, CURSOR_PROXY_HOST = "127.0.0.1", CURSOR_PROXY_DEFAULT_PORT = 32124, CURSOR_PROXY_DEFAULT_BASE_URL, REUSE_EXISTING_PROXY, SESSION_WORKSPACE_CACHE_LIMIT = 200, FORCE_TOOL_MODE, EMIT_TOOL_UPDATES, FORWARD_TOOL_CALLS, TOOL_LOOP_MODE_RAW, TOOL_LOOP_MODE, TOOL_LOOP_MODE_VALID, PROVIDER_BOUNDARY_MODE_RAW, PROVIDER_BOUNDARY_MODE, PROVIDER_BOUNDARY_MODE_VALID, LEGACY_PROVIDER_BOUNDARY, PROVIDER_BOUNDARY, ENABLE_PROVIDER_BOUNDARY_AUTOFALLBACK, TOOL_LOOP_MAX_REPEAT_RAW, TOOL_LOOP_MAX_REPEAT, TOOL_LOOP_MAX_REPEAT_VALID, PROXY_EXECUTE_TOOL_CALLS, SUPPRESS_CONVERTER_TOOL_EVENTS, SHOULD_EMIT_TOOL_UPDATES, CursorPlugin = async ({ $, directory, worktree, client: client3, serverUrl }) => {
17376
+ var log20, DEBUG_LOG_DIR2, DEBUG_LOG_FILE2, CURSOR_PROVIDER_ID2 = "cursor-acp", CURSOR_PROVIDER_PREFIX, CURSOR_PROXY_HOST = "127.0.0.1", CURSOR_PROXY_DEFAULT_PORT = 32124, CURSOR_PROXY_DEFAULT_BASE_URL, REUSE_EXISTING_PROXY, SESSION_WORKSPACE_CACHE_LIMIT = 200, FORCE_TOOL_MODE, EMIT_TOOL_UPDATES, FORWARD_TOOL_CALLS, TOOL_LOOP_MODE_RAW, TOOL_LOOP_MODE, TOOL_LOOP_MODE_VALID, PROVIDER_BOUNDARY_MODE_RAW, PROVIDER_BOUNDARY_MODE, PROVIDER_BOUNDARY_MODE_VALID, LEGACY_PROVIDER_BOUNDARY, PROVIDER_BOUNDARY, ENABLE_PROVIDER_BOUNDARY_AUTOFALLBACK, TOOL_LOOP_MAX_REPEAT_RAW, TOOL_LOOP_MAX_REPEAT, TOOL_LOOP_MAX_REPEAT_VALID, PROXY_EXECUTE_TOOL_CALLS, SUPPRESS_CONVERTER_TOOL_EVENTS, SHOULD_EMIT_TOOL_UPDATES, NATIVE_TOOL_HOOK_EXCLUSIONS, CursorPlugin = async ({ $, directory, worktree, client: client3, serverUrl }) => {
17426
17377
  const workspaceDirectory = resolveWorkspaceDirectory(worktree, directory);
17427
17378
  log20.debug("Plugin initializing", {
17428
17379
  directory,
@@ -17723,6 +17674,7 @@ var init_plugin = __esm(() => {
17723
17674
  suppressConverterToolEvents: SUPPRESS_CONVERTER_TOOL_EVENTS,
17724
17675
  shouldEmitToolUpdates: SHOULD_EMIT_TOOL_UPDATES
17725
17676
  } = PROVIDER_BOUNDARY.computeToolLoopFlags(TOOL_LOOP_MODE, FORWARD_TOOL_CALLS, EMIT_TOOL_UPDATES));
17677
+ NATIVE_TOOL_HOOK_EXCLUSIONS = new Set(["grep"]);
17726
17678
  plugin_default = CursorPlugin;
17727
17679
  });
17728
17680
 
@@ -13796,7 +13796,7 @@ ${output}`);
13796
13796
  if (include) {
13797
13797
  grepArgs.push(`--include=${include}`);
13798
13798
  }
13799
- grepArgs.push(pattern, path2);
13799
+ grepArgs.push("-e", pattern, path2);
13800
13800
  const runGrep = async (extraArgs = []) => {
13801
13801
  return execFileAsync("grep", [...extraArgs, ...grepArgs], { timeout: 30000 });
13802
13802
  };
@@ -14563,8 +14563,8 @@ function normalizeToolSpecificArgs(toolName, args) {
14563
14563
  if (!hasStringNew && typeof content === "string") {
14564
14564
  repaired.new_string = content;
14565
14565
  }
14566
- if (typeof repaired.new_string === "string" && !hasStringOld) {
14567
- repaired.old_string = "";
14566
+ if (hasStringOld && repaired.old_string === "") {
14567
+ delete repaired.old_string;
14568
14568
  }
14569
14569
  return repaired;
14570
14570
  }
@@ -14867,15 +14867,7 @@ async function handleToolLoopEventLegacy(options) {
14867
14867
  }
14868
14868
  return { intercepted: false, skipConverter: true, terminate: validationTermination };
14869
14869
  }
14870
- const reroutedWrite = tryRerouteEditToWrite(normalizedToolCall, compat.normalizedArgs, allowedToolNames, toolSchemaMap);
14871
- if (reroutedWrite) {
14872
- log18.debug("Rerouting malformed edit call to write (legacy)", {
14873
- path: reroutedWrite.path,
14874
- missing: compat.validation.missing,
14875
- typeErrors: compat.validation.typeErrors
14876
- });
14877
- normalizedToolCall = reroutedWrite.toolCall;
14878
- } else if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
14870
+ if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
14879
14871
  const hintChunk = createNonFatalSchemaValidationHintChunk(responseMeta, normalizedToolCall, compat.validation);
14880
14872
  log18.debug("Emitting non-fatal schema validation hint in legacy and skipping malformed tool execution", {
14881
14873
  tool: normalizedToolCall.function.name,
@@ -15019,19 +15011,6 @@ async function handleToolLoopEventV1(options) {
15019
15011
  }
15020
15012
  return { intercepted: false, skipConverter: true, terminate: termination2 };
15021
15013
  }
15022
- const reroutedWrite = tryRerouteEditToWrite(normalizedToolCall, compat.normalizedArgs, allowedToolNames, toolSchemaMap);
15023
- if (reroutedWrite) {
15024
- log18.debug("Rerouting malformed edit call to write", {
15025
- path: reroutedWrite.path,
15026
- missing: compat.validation.missing,
15027
- typeErrors: compat.validation.typeErrors
15028
- });
15029
- await onInterceptedToolCall(reroutedWrite.toolCall);
15030
- return {
15031
- intercepted: true,
15032
- skipConverter: true
15033
- };
15034
- }
15035
15014
  if (schemaValidationFailureMode === "pass_through" && shouldTerminateOnSchemaValidation(normalizedToolCall, compat.validation)) {
15036
15015
  return {
15037
15016
  intercepted: false,
@@ -15341,36 +15320,6 @@ function shouldUsePassThroughForEditSchema(event) {
15341
15320
  const normalizedName = rawName.endsWith("ToolCall") ? rawName.slice(0, -"ToolCall".length) : rawName;
15342
15321
  return normalizedName.toLowerCase() === "edit";
15343
15322
  }
15344
- function tryRerouteEditToWrite(toolCall, normalizedArgs, allowedToolNames, toolSchemaMap) {
15345
- if (toolCall.function.name.toLowerCase() !== "edit") {
15346
- return null;
15347
- }
15348
- if (!allowedToolNames.has("write") || !toolSchemaMap.has("write")) {
15349
- return null;
15350
- }
15351
- const path2 = typeof normalizedArgs.path === "string" && normalizedArgs.path.length > 0 ? normalizedArgs.path : null;
15352
- if (!path2) {
15353
- return null;
15354
- }
15355
- const content = typeof normalizedArgs.new_string === "string" ? normalizedArgs.new_string : typeof normalizedArgs.content === "string" ? normalizedArgs.content : null;
15356
- if (content === null) {
15357
- return null;
15358
- }
15359
- const oldString = normalizedArgs.old_string;
15360
- if (typeof oldString === "string" && oldString.length > 0) {
15361
- return null;
15362
- }
15363
- return {
15364
- path: path2,
15365
- toolCall: {
15366
- ...toolCall,
15367
- function: {
15368
- name: "write",
15369
- arguments: JSON.stringify({ path: path2, content })
15370
- }
15371
- }
15372
- };
15373
- }
15374
15323
  function isRecord4(value) {
15375
15324
  return typeof value === "object" && value !== null && !Array.isArray(value);
15376
15325
  }
@@ -17398,6 +17347,8 @@ function buildToolHookEntries(registry, fallbackBaseDir) {
17398
17347
  const sessionWorkspaceBySession = new Map;
17399
17348
  const tools = registry.list();
17400
17349
  for (const t of tools) {
17350
+ if (NATIVE_TOOL_HOOK_EXCLUSIONS.has(t.name))
17351
+ continue;
17401
17352
  const handler = registry.getHandler(t.name);
17402
17353
  if (!handler)
17403
17354
  continue;
@@ -17422,7 +17373,7 @@ function buildToolHookEntries(registry, fallbackBaseDir) {
17422
17373
  }
17423
17374
  return entries;
17424
17375
  }
17425
- var log20, DEBUG_LOG_DIR2, DEBUG_LOG_FILE2, CURSOR_PROVIDER_ID2 = "cursor-acp", CURSOR_PROVIDER_PREFIX, CURSOR_PROXY_HOST = "127.0.0.1", CURSOR_PROXY_DEFAULT_PORT = 32124, CURSOR_PROXY_DEFAULT_BASE_URL, REUSE_EXISTING_PROXY, SESSION_WORKSPACE_CACHE_LIMIT = 200, FORCE_TOOL_MODE, EMIT_TOOL_UPDATES, FORWARD_TOOL_CALLS, TOOL_LOOP_MODE_RAW, TOOL_LOOP_MODE, TOOL_LOOP_MODE_VALID, PROVIDER_BOUNDARY_MODE_RAW, PROVIDER_BOUNDARY_MODE, PROVIDER_BOUNDARY_MODE_VALID, LEGACY_PROVIDER_BOUNDARY, PROVIDER_BOUNDARY, ENABLE_PROVIDER_BOUNDARY_AUTOFALLBACK, TOOL_LOOP_MAX_REPEAT_RAW, TOOL_LOOP_MAX_REPEAT, TOOL_LOOP_MAX_REPEAT_VALID, PROXY_EXECUTE_TOOL_CALLS, SUPPRESS_CONVERTER_TOOL_EVENTS, SHOULD_EMIT_TOOL_UPDATES, CursorPlugin = async ({ $, directory, worktree, client: client3, serverUrl }) => {
17376
+ var log20, DEBUG_LOG_DIR2, DEBUG_LOG_FILE2, CURSOR_PROVIDER_ID2 = "cursor-acp", CURSOR_PROVIDER_PREFIX, CURSOR_PROXY_HOST = "127.0.0.1", CURSOR_PROXY_DEFAULT_PORT = 32124, CURSOR_PROXY_DEFAULT_BASE_URL, REUSE_EXISTING_PROXY, SESSION_WORKSPACE_CACHE_LIMIT = 200, FORCE_TOOL_MODE, EMIT_TOOL_UPDATES, FORWARD_TOOL_CALLS, TOOL_LOOP_MODE_RAW, TOOL_LOOP_MODE, TOOL_LOOP_MODE_VALID, PROVIDER_BOUNDARY_MODE_RAW, PROVIDER_BOUNDARY_MODE, PROVIDER_BOUNDARY_MODE_VALID, LEGACY_PROVIDER_BOUNDARY, PROVIDER_BOUNDARY, ENABLE_PROVIDER_BOUNDARY_AUTOFALLBACK, TOOL_LOOP_MAX_REPEAT_RAW, TOOL_LOOP_MAX_REPEAT, TOOL_LOOP_MAX_REPEAT_VALID, PROXY_EXECUTE_TOOL_CALLS, SUPPRESS_CONVERTER_TOOL_EVENTS, SHOULD_EMIT_TOOL_UPDATES, NATIVE_TOOL_HOOK_EXCLUSIONS, CursorPlugin = async ({ $, directory, worktree, client: client3, serverUrl }) => {
17426
17377
  const workspaceDirectory = resolveWorkspaceDirectory(worktree, directory);
17427
17378
  log20.debug("Plugin initializing", {
17428
17379
  directory,
@@ -17723,6 +17674,7 @@ var init_plugin = __esm(() => {
17723
17674
  suppressConverterToolEvents: SUPPRESS_CONVERTER_TOOL_EVENTS,
17724
17675
  shouldEmitToolUpdates: SHOULD_EMIT_TOOL_UPDATES
17725
17676
  } = PROVIDER_BOUNDARY.computeToolLoopFlags(TOOL_LOOP_MODE, FORWARD_TOOL_CALLS, EMIT_TOOL_UPDATES));
17677
+ NATIVE_TOOL_HOOK_EXCLUSIONS = new Set(["grep"]);
17726
17678
  plugin_default = CursorPlugin;
17727
17679
  });
17728
17680
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rama_nigg/open-cursor",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "No prompt limits. No broken streams. Full thinking + tool support. Your Cursor subscription, properly integrated.",
5
5
  "type": "module",
6
6
  "main": "dist/plugin-entry.js",
package/src/plugin.ts CHANGED
@@ -1843,11 +1843,15 @@ function applyToolContextDefaults(
1843
1843
  /**
1844
1844
  * Build tool hook entries from local registry
1845
1845
  */
1846
+ const NATIVE_TOOL_HOOK_EXCLUSIONS = new Set(["grep"]);
1847
+
1846
1848
  function buildToolHookEntries(registry: CoreRegistry, fallbackBaseDir?: string): Record<string, any> {
1847
1849
  const entries: Record<string, any> = {};
1848
1850
  const sessionWorkspaceBySession = new Map<string, string>();
1849
1851
  const tools = registry.list();
1850
1852
  for (const t of tools) {
1853
+ if (NATIVE_TOOL_HOOK_EXCLUSIONS.has(t.name)) continue;
1854
+
1851
1855
  const handler = registry.getHandler(t.name);
1852
1856
  if (!handler) continue;
1853
1857
 
@@ -190,20 +190,7 @@ export async function handleToolLoopEventLegacy(
190
190
  return { intercepted: false, skipConverter: true, terminate: validationTermination };
191
191
  }
192
192
 
193
- const reroutedWrite = tryRerouteEditToWrite(
194
- normalizedToolCall,
195
- compat.normalizedArgs,
196
- allowedToolNames,
197
- toolSchemaMap,
198
- );
199
- if (reroutedWrite) {
200
- log.debug("Rerouting malformed edit call to write (legacy)", {
201
- path: reroutedWrite.path,
202
- missing: compat.validation.missing,
203
- typeErrors: compat.validation.typeErrors,
204
- });
205
- normalizedToolCall = reroutedWrite.toolCall;
206
- } else if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
193
+ if (shouldEmitNonFatalSchemaValidationHint(normalizedToolCall, compat.validation)) {
207
194
  const hintChunk = createNonFatalSchemaValidationHintChunk(
208
195
  responseMeta,
209
196
  normalizedToolCall,
@@ -386,24 +373,6 @@ export async function handleToolLoopEventV1(
386
373
  }
387
374
  return { intercepted: false, skipConverter: true, terminate: termination };
388
375
  }
389
- const reroutedWrite = tryRerouteEditToWrite(
390
- normalizedToolCall,
391
- compat.normalizedArgs,
392
- allowedToolNames,
393
- toolSchemaMap,
394
- );
395
- if (reroutedWrite) {
396
- log.debug("Rerouting malformed edit call to write", {
397
- path: reroutedWrite.path,
398
- missing: compat.validation.missing,
399
- typeErrors: compat.validation.typeErrors,
400
- });
401
- await onInterceptedToolCall(reroutedWrite.toolCall);
402
- return {
403
- intercepted: true,
404
- skipConverter: true,
405
- };
406
- }
407
376
  if (
408
377
  schemaValidationFailureMode === "pass_through"
409
378
  && shouldTerminateOnSchemaValidation(normalizedToolCall, compat.validation)
@@ -809,53 +778,6 @@ function shouldUsePassThroughForEditSchema(event: StreamJsonToolCallEvent): bool
809
778
  return normalizedName.toLowerCase() === "edit";
810
779
  }
811
780
 
812
- function tryRerouteEditToWrite(
813
- toolCall: OpenAiToolCall,
814
- normalizedArgs: Record<string, unknown>,
815
- allowedToolNames: Set<string>,
816
- toolSchemaMap: Map<string, unknown>,
817
- ): { path: string; toolCall: OpenAiToolCall } | null {
818
- if (toolCall.function.name.toLowerCase() !== "edit") {
819
- return null;
820
- }
821
- if (!allowedToolNames.has("write") || !toolSchemaMap.has("write")) {
822
- return null;
823
- }
824
-
825
- const path = typeof normalizedArgs.path === "string" && normalizedArgs.path.length > 0
826
- ? normalizedArgs.path
827
- : null;
828
- if (!path) {
829
- return null;
830
- }
831
-
832
- const content =
833
- typeof normalizedArgs.new_string === "string"
834
- ? normalizedArgs.new_string
835
- : typeof normalizedArgs.content === "string"
836
- ? normalizedArgs.content
837
- : null;
838
- if (content === null) {
839
- return null;
840
- }
841
-
842
- const oldString = normalizedArgs.old_string;
843
- if (typeof oldString === "string" && oldString.length > 0) {
844
- return null;
845
- }
846
-
847
- return {
848
- path,
849
- toolCall: {
850
- ...toolCall,
851
- function: {
852
- name: "write",
853
- arguments: JSON.stringify({ path, content }),
854
- },
855
- },
856
- };
857
- }
858
-
859
781
  function isRecord(value: unknown): value is Record<string, unknown> {
860
782
  return typeof value === "object" && value !== null && !Array.isArray(value);
861
783
  }
@@ -261,8 +261,8 @@ function normalizeToolSpecificArgs(toolName: string, args: JsonRecord): JsonReco
261
261
  if (!hasStringNew && typeof content === "string") {
262
262
  repaired.new_string = content;
263
263
  }
264
- if (typeof repaired.new_string === "string" && !hasStringOld) {
265
- repaired.old_string = "";
264
+ if (hasStringOld && repaired.old_string === "") {
265
+ delete repaired.old_string;
266
266
  }
267
267
 
268
268
  return repaired;
@@ -274,7 +274,7 @@ export function registerDefaultTools(registry: ToolRegistry): void {
274
274
  if (include) {
275
275
  grepArgs.push(`--include=${include}`);
276
276
  }
277
- grepArgs.push(pattern, path);
277
+ grepArgs.push("-e", pattern, path);
278
278
 
279
279
  const runGrep = async (extraArgs: string[] = []) => {
280
280
  return execFileAsync("grep", [...extraArgs, ...grepArgs], { timeout: 30000 });