@google/gemini-cli-core 0.2.0-preview.1 → 0.2.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.
Files changed (221) hide show
  1. package/README.md +2 -32
  2. package/dist/google-gemini-cli-core-0.2.0-preview.2.tgz +0 -0
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/src/code_assist/oauth2.js +15 -9
  7. package/dist/src/code_assist/oauth2.js.map +1 -1
  8. package/dist/src/code_assist/oauth2.test.js +4 -6
  9. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  10. package/dist/src/config/config.d.ts +2 -12
  11. package/dist/src/config/config.js +11 -30
  12. package/dist/src/config/config.js.map +1 -1
  13. package/dist/src/config/config.test.js +2 -33
  14. package/dist/src/config/config.test.js.map +1 -1
  15. package/dist/src/core/client.js +3 -0
  16. package/dist/src/core/client.js.map +1 -1
  17. package/dist/src/core/client.test.js +61 -0
  18. package/dist/src/core/client.test.js.map +1 -1
  19. package/dist/src/core/contentGenerator.js +2 -3
  20. package/dist/src/core/contentGenerator.js.map +1 -1
  21. package/dist/src/core/coreToolScheduler.d.ts +3 -2
  22. package/dist/src/core/coreToolScheduler.js +1 -1
  23. package/dist/src/core/coreToolScheduler.js.map +1 -1
  24. package/dist/src/core/coreToolScheduler.test.js +11 -10
  25. package/dist/src/core/coreToolScheduler.test.js.map +1 -1
  26. package/dist/src/core/geminiChat.d.ts +9 -4
  27. package/dist/src/core/geminiChat.js +161 -168
  28. package/dist/src/core/geminiChat.js.map +1 -1
  29. package/dist/src/core/geminiChat.test.js +296 -2
  30. package/dist/src/core/geminiChat.test.js.map +1 -1
  31. package/dist/src/core/logger.d.ts +1 -3
  32. package/dist/src/core/logger.js +3 -4
  33. package/dist/src/core/logger.js.map +1 -1
  34. package/dist/src/core/logger.test.js +16 -17
  35. package/dist/src/core/logger.test.js.map +1 -1
  36. package/dist/src/core/nonInteractiveToolExecutor.d.ts +5 -3
  37. package/dist/src/core/nonInteractiveToolExecutor.js +122 -14
  38. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
  39. package/dist/src/core/nonInteractiveToolExecutor.test.js +53 -56
  40. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
  41. package/dist/src/core/turn.js +4 -4
  42. package/dist/src/core/turn.js.map +1 -1
  43. package/dist/src/core/turn.test.js +0 -19
  44. package/dist/src/core/turn.test.js.map +1 -1
  45. package/dist/src/generated/git-commit.d.ts +2 -2
  46. package/dist/src/generated/git-commit.js +2 -2
  47. package/dist/src/generated/git-commit.js.map +1 -1
  48. package/dist/src/ide/ide-client.d.ts +2 -4
  49. package/dist/src/ide/ide-client.js +16 -81
  50. package/dist/src/ide/ide-client.js.map +1 -1
  51. package/dist/src/ide/ide-client.test.js +33 -141
  52. package/dist/src/ide/ide-client.test.js.map +1 -1
  53. package/dist/src/ide/ideContext.d.ts +5 -5
  54. package/dist/src/index.d.ts +0 -3
  55. package/dist/src/index.js +0 -3
  56. package/dist/src/index.js.map +1 -1
  57. package/dist/src/mcp/oauth-token-storage.d.ts +2 -0
  58. package/dist/src/mcp/oauth-token-storage.js +5 -2
  59. package/dist/src/mcp/oauth-token-storage.js.map +1 -1
  60. package/dist/src/mcp/oauth-token-storage.test.js +0 -1
  61. package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
  62. package/dist/src/services/chatRecordingService.js +2 -2
  63. package/dist/src/services/chatRecordingService.js.map +1 -1
  64. package/dist/src/services/chatRecordingService.test.js +3 -5
  65. package/dist/src/services/chatRecordingService.test.js.map +1 -1
  66. package/dist/src/services/gitService.d.ts +1 -3
  67. package/dist/src/services/gitService.js +10 -19
  68. package/dist/src/services/gitService.js.map +1 -1
  69. package/dist/src/services/gitService.test.js +14 -17
  70. package/dist/src/services/gitService.test.js.map +1 -1
  71. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +9 -7
  72. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +59 -75
  73. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  74. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +9 -66
  75. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
  76. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +20 -7
  77. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +46 -11
  78. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  79. package/dist/src/telemetry/constants.d.ts +6 -0
  80. package/dist/src/telemetry/constants.js +6 -0
  81. package/dist/src/telemetry/constants.js.map +1 -1
  82. package/dist/src/telemetry/loggers.d.ts +4 -2
  83. package/dist/src/telemetry/loggers.js +56 -11
  84. package/dist/src/telemetry/loggers.js.map +1 -1
  85. package/dist/src/telemetry/loggers.test.js +0 -4
  86. package/dist/src/telemetry/loggers.test.js.map +1 -1
  87. package/dist/src/telemetry/metrics.d.ts +13 -1
  88. package/dist/src/telemetry/metrics.js +43 -5
  89. package/dist/src/telemetry/metrics.js.map +1 -1
  90. package/dist/src/telemetry/types.d.ts +23 -19
  91. package/dist/src/telemetry/types.js +36 -33
  92. package/dist/src/telemetry/types.js.map +1 -1
  93. package/dist/src/tools/edit.js +4 -25
  94. package/dist/src/tools/edit.js.map +1 -1
  95. package/dist/src/tools/edit.test.js +0 -24
  96. package/dist/src/tools/edit.test.js.map +1 -1
  97. package/dist/src/tools/glob.js +2 -13
  98. package/dist/src/tools/glob.js.map +1 -1
  99. package/dist/src/tools/glob.test.js +1 -23
  100. package/dist/src/tools/glob.test.js.map +1 -1
  101. package/dist/src/tools/grep.js +0 -5
  102. package/dist/src/tools/grep.js.map +1 -1
  103. package/dist/src/tools/grep.test.js +0 -11
  104. package/dist/src/tools/grep.test.js.map +1 -1
  105. package/dist/src/tools/ls.js +4 -9
  106. package/dist/src/tools/ls.js.map +1 -1
  107. package/dist/src/tools/ls.test.js +0 -5
  108. package/dist/src/tools/ls.test.js.map +1 -1
  109. package/dist/src/tools/mcp-client.d.ts +0 -7
  110. package/dist/src/tools/mcp-client.js +21 -26
  111. package/dist/src/tools/mcp-client.js.map +1 -1
  112. package/dist/src/tools/mcp-client.test.js +1 -26
  113. package/dist/src/tools/mcp-client.test.js.map +1 -1
  114. package/dist/src/tools/mcp-tool.js +2 -12
  115. package/dist/src/tools/mcp-tool.js.map +1 -1
  116. package/dist/src/tools/mcp-tool.test.js +3 -20
  117. package/dist/src/tools/mcp-tool.test.js.map +1 -1
  118. package/dist/src/tools/memoryTool.js +2 -7
  119. package/dist/src/tools/memoryTool.js.map +1 -1
  120. package/dist/src/tools/memoryTool.test.js +1 -13
  121. package/dist/src/tools/memoryTool.test.js.map +1 -1
  122. package/dist/src/tools/read-file.js +32 -10
  123. package/dist/src/tools/read-file.js.map +1 -1
  124. package/dist/src/tools/read-file.test.js +2 -5
  125. package/dist/src/tools/read-file.test.js.map +1 -1
  126. package/dist/src/tools/read-many-files.js +11 -21
  127. package/dist/src/tools/read-many-files.js.map +1 -1
  128. package/dist/src/tools/read-many-files.test.js +4 -42
  129. package/dist/src/tools/read-many-files.test.js.map +1 -1
  130. package/dist/src/tools/shell.js +2 -2
  131. package/dist/src/tools/shell.js.map +1 -1
  132. package/dist/src/tools/shell.test.js +1 -2
  133. package/dist/src/tools/shell.test.js.map +1 -1
  134. package/dist/src/tools/tool-error.d.ts +1 -16
  135. package/dist/src/tools/tool-error.js +0 -24
  136. package/dist/src/tools/tool-error.js.map +1 -1
  137. package/dist/src/tools/tool-registry.js +1 -7
  138. package/dist/src/tools/tool-registry.js.map +1 -1
  139. package/dist/src/tools/tool-registry.test.js +1 -71
  140. package/dist/src/tools/tool-registry.test.js.map +1 -1
  141. package/dist/src/tools/tools.d.ts +5 -1
  142. package/dist/src/tools/tools.js.map +1 -1
  143. package/dist/src/tools/tools.test.js +1 -0
  144. package/dist/src/tools/tools.test.js.map +1 -1
  145. package/dist/src/tools/web-fetch.js +6 -9
  146. package/dist/src/tools/web-fetch.js.map +1 -1
  147. package/dist/src/tools/web-fetch.test.js +16 -55
  148. package/dist/src/tools/web-fetch.test.js.map +1 -1
  149. package/dist/src/tools/web-search.js +5 -26
  150. package/dist/src/tools/web-search.js.map +1 -1
  151. package/dist/src/tools/web-search.test.js +1 -69
  152. package/dist/src/tools/web-search.test.js.map +1 -1
  153. package/dist/src/tools/write-file.js +3 -7
  154. package/dist/src/tools/write-file.js.map +1 -1
  155. package/dist/src/tools/write-file.test.js +0 -3
  156. package/dist/src/tools/write-file.test.js.map +1 -1
  157. package/dist/src/utils/editCorrector.test.js +0 -1
  158. package/dist/src/utils/editCorrector.test.js.map +1 -1
  159. package/dist/src/utils/editor.js +1 -1
  160. package/dist/src/utils/editor.js.map +1 -1
  161. package/dist/src/utils/editor.test.js +1 -1
  162. package/dist/src/utils/editor.test.js.map +1 -1
  163. package/dist/src/utils/fileUtils.d.ts +7 -2
  164. package/dist/src/utils/fileUtils.js +17 -14
  165. package/dist/src/utils/fileUtils.js.map +1 -1
  166. package/dist/src/utils/filesearch/fileSearch.d.ts +0 -1
  167. package/dist/src/utils/filesearch/fileSearch.js +2 -3
  168. package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
  169. package/dist/src/utils/filesearch/fileSearch.test.js +0 -90
  170. package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -1
  171. package/dist/src/utils/memoryDiscovery.js +20 -54
  172. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  173. package/dist/src/utils/memoryDiscovery.test.js +0 -37
  174. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  175. package/dist/src/utils/paths.d.ts +17 -0
  176. package/dist/src/utils/paths.js +26 -0
  177. package/dist/src/utils/paths.js.map +1 -1
  178. package/dist/src/utils/user_account.d.ts +9 -0
  179. package/dist/src/utils/user_account.js +109 -0
  180. package/dist/src/utils/user_account.js.map +1 -0
  181. package/dist/src/utils/{userAccountManager.test.js → user_account.test.js} +30 -33
  182. package/dist/src/utils/user_account.test.js.map +1 -0
  183. package/dist/src/utils/user_id.d.ts +11 -0
  184. package/dist/src/utils/user_id.js +49 -0
  185. package/dist/src/utils/user_id.js.map +1 -0
  186. package/dist/src/utils/user_id.test.js +21 -0
  187. package/dist/src/utils/user_id.test.js.map +1 -0
  188. package/dist/tsconfig.tsbuildinfo +1 -1
  189. package/package.json +1 -1
  190. package/dist/src/config/storage.d.ts +0 -32
  191. package/dist/src/config/storage.js +0 -90
  192. package/dist/src/config/storage.js.map +0 -1
  193. package/dist/src/config/storage.test.js +0 -43
  194. package/dist/src/config/storage.test.js.map +0 -1
  195. package/dist/src/telemetry/telemetry-utils.d.ts +0 -6
  196. package/dist/src/telemetry/telemetry-utils.js +0 -14
  197. package/dist/src/telemetry/telemetry-utils.js.map +0 -1
  198. package/dist/src/telemetry/telemetry-utils.test.js +0 -40
  199. package/dist/src/telemetry/telemetry-utils.test.js.map +0 -1
  200. package/dist/src/tools/ripGrep.d.ts +0 -46
  201. package/dist/src/tools/ripGrep.js +0 -368
  202. package/dist/src/tools/ripGrep.js.map +0 -1
  203. package/dist/src/tools/ripGrep.test.d.ts +0 -6
  204. package/dist/src/tools/ripGrep.test.js +0 -874
  205. package/dist/src/tools/ripGrep.test.js.map +0 -1
  206. package/dist/src/utils/installationManager.d.ts +0 -16
  207. package/dist/src/utils/installationManager.js +0 -50
  208. package/dist/src/utils/installationManager.js.map +0 -1
  209. package/dist/src/utils/installationManager.test.d.ts +0 -6
  210. package/dist/src/utils/installationManager.test.js +0 -83
  211. package/dist/src/utils/installationManager.test.js.map +0 -1
  212. package/dist/src/utils/language-detection.d.ts +0 -6
  213. package/dist/src/utils/language-detection.js +0 -101
  214. package/dist/src/utils/language-detection.js.map +0 -1
  215. package/dist/src/utils/userAccountManager.d.ts +0 -20
  216. package/dist/src/utils/userAccountManager.js +0 -114
  217. package/dist/src/utils/userAccountManager.js.map +0 -1
  218. package/dist/src/utils/userAccountManager.test.d.ts +0 -6
  219. package/dist/src/utils/userAccountManager.test.js.map +0 -1
  220. /package/dist/src/{config/storage.test.d.ts → utils/user_account.test.d.ts} +0 -0
  221. /package/dist/src/{telemetry/telemetry-utils.test.d.ts → utils/user_id.test.d.ts} +0 -0
@@ -1,368 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import fs from 'fs';
7
- import path from 'path';
8
- import { EOL } from 'os';
9
- import { spawn } from 'child_process';
10
- import { rgPath } from '@lvce-editor/ripgrep';
11
- import { BaseDeclarativeTool, BaseToolInvocation, Kind, } from './tools.js';
12
- import { SchemaValidator } from '../utils/schemaValidator.js';
13
- import { makeRelative, shortenPath } from '../utils/paths.js';
14
- import { getErrorMessage, isNodeError } from '../utils/errors.js';
15
- const DEFAULT_TOTAL_MAX_MATCHES = 20000;
16
- class GrepToolInvocation extends BaseToolInvocation {
17
- config;
18
- constructor(config, params) {
19
- super(params);
20
- this.config = config;
21
- }
22
- /**
23
- * Checks if a path is within the root directory and resolves it.
24
- * @param relativePath Path relative to the root directory (or undefined for root).
25
- * @returns The absolute path if valid and exists, or null if no path specified (to search all directories).
26
- * @throws {Error} If path is outside root, doesn't exist, or isn't a directory.
27
- */
28
- resolveAndValidatePath(relativePath) {
29
- // If no path specified, return null to indicate searching all workspace directories
30
- if (!relativePath) {
31
- return null;
32
- }
33
- const targetPath = path.resolve(this.config.getTargetDir(), relativePath);
34
- // Security Check: Ensure the resolved path is within workspace boundaries
35
- const workspaceContext = this.config.getWorkspaceContext();
36
- if (!workspaceContext.isPathWithinWorkspace(targetPath)) {
37
- const directories = workspaceContext.getDirectories();
38
- throw new Error(`Path validation failed: Attempted path "${relativePath}" resolves outside the allowed workspace directories: ${directories.join(', ')}`);
39
- }
40
- // Check existence and type after resolving
41
- try {
42
- const stats = fs.statSync(targetPath);
43
- if (!stats.isDirectory()) {
44
- throw new Error(`Path is not a directory: ${targetPath}`);
45
- }
46
- }
47
- catch (error) {
48
- if (isNodeError(error) && error.code !== 'ENOENT') {
49
- throw new Error(`Path does not exist: ${targetPath}`);
50
- }
51
- throw new Error(`Failed to access path stats for ${targetPath}: ${error}`);
52
- }
53
- return targetPath;
54
- }
55
- async execute(signal) {
56
- try {
57
- const workspaceContext = this.config.getWorkspaceContext();
58
- const searchDirAbs = this.resolveAndValidatePath(this.params.path);
59
- const searchDirDisplay = this.params.path || '.';
60
- // Determine which directories to search
61
- let searchDirectories;
62
- if (searchDirAbs === null) {
63
- // No path specified - search all workspace directories
64
- searchDirectories = workspaceContext.getDirectories();
65
- }
66
- else {
67
- // Specific path provided - search only that directory
68
- searchDirectories = [searchDirAbs];
69
- }
70
- let allMatches = [];
71
- const totalMaxMatches = DEFAULT_TOTAL_MAX_MATCHES;
72
- if (this.config.getDebugMode()) {
73
- console.log(`[GrepTool] Total result limit: ${totalMaxMatches}`);
74
- }
75
- for (const searchDir of searchDirectories) {
76
- const searchResult = await this.performRipgrepSearch({
77
- pattern: this.params.pattern,
78
- path: searchDir,
79
- include: this.params.include,
80
- signal,
81
- });
82
- if (searchDirectories.length > 1) {
83
- const dirName = path.basename(searchDir);
84
- searchResult.forEach((match) => {
85
- match.filePath = path.join(dirName, match.filePath);
86
- });
87
- }
88
- allMatches = allMatches.concat(searchResult);
89
- if (allMatches.length >= totalMaxMatches) {
90
- allMatches = allMatches.slice(0, totalMaxMatches);
91
- break;
92
- }
93
- }
94
- let searchLocationDescription;
95
- if (searchDirAbs === null) {
96
- const numDirs = workspaceContext.getDirectories().length;
97
- searchLocationDescription =
98
- numDirs > 1
99
- ? `across ${numDirs} workspace directories`
100
- : `in the workspace directory`;
101
- }
102
- else {
103
- searchLocationDescription = `in path "${searchDirDisplay}"`;
104
- }
105
- if (allMatches.length === 0) {
106
- const noMatchMsg = `No matches found for pattern "${this.params.pattern}" ${searchLocationDescription}${this.params.include ? ` (filter: "${this.params.include}")` : ''}.`;
107
- return { llmContent: noMatchMsg, returnDisplay: `No matches found` };
108
- }
109
- const wasTruncated = allMatches.length >= totalMaxMatches;
110
- const matchesByFile = allMatches.reduce((acc, match) => {
111
- const fileKey = match.filePath;
112
- if (!acc[fileKey]) {
113
- acc[fileKey] = [];
114
- }
115
- acc[fileKey].push(match);
116
- acc[fileKey].sort((a, b) => a.lineNumber - b.lineNumber);
117
- return acc;
118
- }, {});
119
- const matchCount = allMatches.length;
120
- const matchTerm = matchCount === 1 ? 'match' : 'matches';
121
- let llmContent = `Found ${matchCount} ${matchTerm} for pattern "${this.params.pattern}" ${searchLocationDescription}${this.params.include ? ` (filter: "${this.params.include}")` : ''}`;
122
- if (wasTruncated) {
123
- llmContent += ` (results limited to ${totalMaxMatches} matches for performance)`;
124
- }
125
- llmContent += `:\n---\n`;
126
- for (const filePath in matchesByFile) {
127
- llmContent += `File: ${filePath}\n`;
128
- matchesByFile[filePath].forEach((match) => {
129
- const trimmedLine = match.line.trim();
130
- llmContent += `L${match.lineNumber}: ${trimmedLine}\n`;
131
- });
132
- llmContent += '---\n';
133
- }
134
- let displayMessage = `Found ${matchCount} ${matchTerm}`;
135
- if (wasTruncated) {
136
- displayMessage += ` (limited)`;
137
- }
138
- return {
139
- llmContent: llmContent.trim(),
140
- returnDisplay: displayMessage,
141
- };
142
- }
143
- catch (error) {
144
- console.error(`Error during GrepLogic execution: ${error}`);
145
- const errorMessage = getErrorMessage(error);
146
- return {
147
- llmContent: `Error during grep search operation: ${errorMessage}`,
148
- returnDisplay: `Error: ${errorMessage}`,
149
- };
150
- }
151
- }
152
- parseRipgrepOutput(output, basePath) {
153
- const results = [];
154
- if (!output)
155
- return results;
156
- const lines = output.split(EOL);
157
- for (const line of lines) {
158
- if (!line.trim())
159
- continue;
160
- const firstColonIndex = line.indexOf(':');
161
- if (firstColonIndex === -1)
162
- continue;
163
- const secondColonIndex = line.indexOf(':', firstColonIndex + 1);
164
- if (secondColonIndex === -1)
165
- continue;
166
- const filePathRaw = line.substring(0, firstColonIndex);
167
- const lineNumberStr = line.substring(firstColonIndex + 1, secondColonIndex);
168
- const lineContent = line.substring(secondColonIndex + 1);
169
- const lineNumber = parseInt(lineNumberStr, 10);
170
- if (!isNaN(lineNumber)) {
171
- const absoluteFilePath = path.resolve(basePath, filePathRaw);
172
- const relativeFilePath = path.relative(basePath, absoluteFilePath);
173
- results.push({
174
- filePath: relativeFilePath || path.basename(absoluteFilePath),
175
- lineNumber,
176
- line: lineContent,
177
- });
178
- }
179
- }
180
- return results;
181
- }
182
- async performRipgrepSearch(options) {
183
- const { pattern, path: absolutePath, include } = options;
184
- const rgArgs = [
185
- '--line-number',
186
- '--no-heading',
187
- '--with-filename',
188
- '--ignore-case',
189
- '--regexp',
190
- pattern,
191
- ];
192
- if (include) {
193
- rgArgs.push('--glob', include);
194
- }
195
- const excludes = [
196
- '.git',
197
- 'node_modules',
198
- 'bower_components',
199
- '*.log',
200
- '*.tmp',
201
- 'build',
202
- 'dist',
203
- 'coverage',
204
- ];
205
- excludes.forEach((exclude) => {
206
- rgArgs.push('--glob', `!${exclude}`);
207
- });
208
- rgArgs.push('--threads', '4');
209
- rgArgs.push(absolutePath);
210
- try {
211
- const output = await new Promise((resolve, reject) => {
212
- const child = spawn(rgPath, rgArgs, {
213
- windowsHide: true,
214
- });
215
- const stdoutChunks = [];
216
- const stderrChunks = [];
217
- const cleanup = () => {
218
- if (options.signal.aborted) {
219
- child.kill();
220
- }
221
- };
222
- options.signal.addEventListener('abort', cleanup, { once: true });
223
- child.stdout.on('data', (chunk) => stdoutChunks.push(chunk));
224
- child.stderr.on('data', (chunk) => stderrChunks.push(chunk));
225
- child.on('error', (err) => {
226
- options.signal.removeEventListener('abort', cleanup);
227
- reject(new Error(`Failed to start ripgrep: ${err.message}. Please ensure @lvce-editor/ripgrep is properly installed.`));
228
- });
229
- child.on('close', (code) => {
230
- options.signal.removeEventListener('abort', cleanup);
231
- const stdoutData = Buffer.concat(stdoutChunks).toString('utf8');
232
- const stderrData = Buffer.concat(stderrChunks).toString('utf8');
233
- if (code === 0) {
234
- resolve(stdoutData);
235
- }
236
- else if (code === 1) {
237
- resolve(''); // No matches found
238
- }
239
- else {
240
- reject(new Error(`ripgrep exited with code ${code}: ${stderrData}`));
241
- }
242
- });
243
- });
244
- return this.parseRipgrepOutput(output, absolutePath);
245
- }
246
- catch (error) {
247
- console.error(`GrepLogic: ripgrep failed: ${getErrorMessage(error)}`);
248
- throw error;
249
- }
250
- }
251
- /**
252
- * Gets a description of the grep operation
253
- * @param params Parameters for the grep operation
254
- * @returns A string describing the grep
255
- */
256
- getDescription() {
257
- let description = `'${this.params.pattern}'`;
258
- if (this.params.include) {
259
- description += ` in ${this.params.include}`;
260
- }
261
- if (this.params.path) {
262
- const resolvedPath = path.resolve(this.config.getTargetDir(), this.params.path);
263
- if (resolvedPath === this.config.getTargetDir() ||
264
- this.params.path === '.') {
265
- description += ` within ./`;
266
- }
267
- else {
268
- const relativePath = makeRelative(resolvedPath, this.config.getTargetDir());
269
- description += ` within ${shortenPath(relativePath)}`;
270
- }
271
- }
272
- else {
273
- // When no path is specified, indicate searching all workspace directories
274
- const workspaceContext = this.config.getWorkspaceContext();
275
- const directories = workspaceContext.getDirectories();
276
- if (directories.length > 1) {
277
- description += ` across all workspace directories`;
278
- }
279
- }
280
- return description;
281
- }
282
- }
283
- /**
284
- * Implementation of the Grep tool logic (moved from CLI)
285
- */
286
- export class RipGrepTool extends BaseDeclarativeTool {
287
- config;
288
- static Name = 'search_file_content';
289
- constructor(config) {
290
- super(RipGrepTool.Name, 'SearchText', 'Searches for a regular expression pattern within the content of files in a specified directory (or current working directory). Can filter files by a glob pattern. Returns the lines containing matches, along with their file paths and line numbers. Total results limited to 20,000 matches like VSCode.', Kind.Search, {
291
- properties: {
292
- pattern: {
293
- description: "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').",
294
- type: 'string',
295
- },
296
- path: {
297
- description: 'Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.',
298
- type: 'string',
299
- },
300
- include: {
301
- description: "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).",
302
- type: 'string',
303
- },
304
- },
305
- required: ['pattern'],
306
- type: 'object',
307
- });
308
- this.config = config;
309
- }
310
- /**
311
- * Checks if a path is within the root directory and resolves it.
312
- * @param relativePath Path relative to the root directory (or undefined for root).
313
- * @returns The absolute path if valid and exists, or null if no path specified (to search all directories).
314
- * @throws {Error} If path is outside root, doesn't exist, or isn't a directory.
315
- */
316
- resolveAndValidatePath(relativePath) {
317
- // If no path specified, return null to indicate searching all workspace directories
318
- if (!relativePath) {
319
- return null;
320
- }
321
- const targetPath = path.resolve(this.config.getTargetDir(), relativePath);
322
- // Security Check: Ensure the resolved path is within workspace boundaries
323
- const workspaceContext = this.config.getWorkspaceContext();
324
- if (!workspaceContext.isPathWithinWorkspace(targetPath)) {
325
- const directories = workspaceContext.getDirectories();
326
- throw new Error(`Path validation failed: Attempted path "${relativePath}" resolves outside the allowed workspace directories: ${directories.join(', ')}`);
327
- }
328
- // Check existence and type after resolving
329
- try {
330
- const stats = fs.statSync(targetPath);
331
- if (!stats.isDirectory()) {
332
- throw new Error(`Path is not a directory: ${targetPath}`);
333
- }
334
- }
335
- catch (error) {
336
- if (isNodeError(error) && error.code !== 'ENOENT') {
337
- throw new Error(`Path does not exist: ${targetPath}`);
338
- }
339
- throw new Error(`Failed to access path stats for ${targetPath}: ${error}`);
340
- }
341
- return targetPath;
342
- }
343
- /**
344
- * Validates the parameters for the tool
345
- * @param params Parameters to validate
346
- * @returns An error message string if invalid, null otherwise
347
- */
348
- validateToolParams(params) {
349
- const errors = SchemaValidator.validate(this.schema.parametersJsonSchema, params);
350
- if (errors) {
351
- return errors;
352
- }
353
- // Only validate path if one is provided
354
- if (params.path) {
355
- try {
356
- this.resolveAndValidatePath(params.path);
357
- }
358
- catch (error) {
359
- return getErrorMessage(error);
360
- }
361
- }
362
- return null; // Parameters are valid
363
- }
364
- createInvocation(params) {
365
- return new GrepToolInvocation(this.config, params);
366
- }
367
- }
368
- //# sourceMappingURL=ripGrep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ripGrep.js","sourceRoot":"","sources":["../../../src/tools/ripGrep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,IAAI,GAGL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGlE,MAAM,yBAAyB,GAAG,KAAK,CAAC;AA+BxC,MAAM,kBAAmB,SAAQ,kBAGhC;IAEoB;IADnB,YACmB,MAAc,EAC/B,MAAyB;QAEzB,KAAK,CAAC,MAAM,CAAC,CAAC;QAHG,WAAM,GAAN,MAAM,CAAQ;IAIjC,CAAC;IAED;;;;;OAKG;IACK,sBAAsB,CAAC,YAAqB;QAClD,oFAAoF;QACpF,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,YAAY,CAAC,CAAC;QAE1E,0EAA0E;QAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC3D,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,UAAU,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