wave-agent-sdk 0.0.7 → 0.0.10

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 (240) hide show
  1. package/dist/agent.d.ts +105 -24
  2. package/dist/agent.d.ts.map +1 -1
  3. package/dist/agent.js +438 -53
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +4 -0
  7. package/dist/managers/aiManager.d.ts +18 -7
  8. package/dist/managers/aiManager.d.ts.map +1 -1
  9. package/dist/managers/aiManager.js +254 -142
  10. package/dist/managers/backgroundBashManager.d.ts.map +1 -1
  11. package/dist/managers/backgroundBashManager.js +11 -9
  12. package/dist/managers/hookManager.d.ts +6 -6
  13. package/dist/managers/hookManager.d.ts.map +1 -1
  14. package/dist/managers/hookManager.js +81 -39
  15. package/dist/managers/liveConfigManager.d.ts +95 -0
  16. package/dist/managers/liveConfigManager.d.ts.map +1 -0
  17. package/dist/managers/liveConfigManager.js +442 -0
  18. package/dist/managers/lspManager.d.ts +43 -0
  19. package/dist/managers/lspManager.d.ts.map +1 -0
  20. package/dist/managers/lspManager.js +326 -0
  21. package/dist/managers/messageManager.d.ts +41 -24
  22. package/dist/managers/messageManager.d.ts.map +1 -1
  23. package/dist/managers/messageManager.js +184 -73
  24. package/dist/managers/permissionManager.d.ts +66 -0
  25. package/dist/managers/permissionManager.d.ts.map +1 -0
  26. package/dist/managers/permissionManager.js +208 -0
  27. package/dist/managers/skillManager.d.ts +1 -0
  28. package/dist/managers/skillManager.d.ts.map +1 -1
  29. package/dist/managers/skillManager.js +2 -1
  30. package/dist/managers/slashCommandManager.d.ts.map +1 -1
  31. package/dist/managers/slashCommandManager.js +4 -2
  32. package/dist/managers/subagentManager.d.ts +42 -6
  33. package/dist/managers/subagentManager.d.ts.map +1 -1
  34. package/dist/managers/subagentManager.js +213 -62
  35. package/dist/managers/toolManager.d.ts +38 -1
  36. package/dist/managers/toolManager.d.ts.map +1 -1
  37. package/dist/managers/toolManager.js +66 -2
  38. package/dist/services/aiService.d.ts +15 -5
  39. package/dist/services/aiService.d.ts.map +1 -1
  40. package/dist/services/aiService.js +446 -77
  41. package/dist/services/configurationService.d.ts +116 -0
  42. package/dist/services/configurationService.d.ts.map +1 -0
  43. package/dist/services/configurationService.js +585 -0
  44. package/dist/services/fileWatcher.d.ts +69 -0
  45. package/dist/services/fileWatcher.d.ts.map +1 -0
  46. package/dist/services/fileWatcher.js +212 -0
  47. package/dist/services/hook.d.ts +5 -40
  48. package/dist/services/hook.d.ts.map +1 -1
  49. package/dist/services/hook.js +47 -109
  50. package/dist/services/jsonlHandler.d.ts +71 -0
  51. package/dist/services/jsonlHandler.d.ts.map +1 -0
  52. package/dist/services/jsonlHandler.js +236 -0
  53. package/dist/services/memory.d.ts.map +1 -1
  54. package/dist/services/memory.js +33 -11
  55. package/dist/services/session.d.ts +116 -52
  56. package/dist/services/session.d.ts.map +1 -1
  57. package/dist/services/session.js +415 -143
  58. package/dist/tools/bashTool.d.ts.map +1 -1
  59. package/dist/tools/bashTool.js +77 -17
  60. package/dist/tools/deleteFileTool.d.ts.map +1 -1
  61. package/dist/tools/deleteFileTool.js +27 -1
  62. package/dist/tools/editTool.d.ts.map +1 -1
  63. package/dist/tools/editTool.js +33 -8
  64. package/dist/tools/lspTool.d.ts +6 -0
  65. package/dist/tools/lspTool.d.ts.map +1 -0
  66. package/dist/tools/lspTool.js +589 -0
  67. package/dist/tools/multiEditTool.d.ts.map +1 -1
  68. package/dist/tools/multiEditTool.js +30 -10
  69. package/dist/tools/readTool.d.ts.map +1 -1
  70. package/dist/tools/readTool.js +113 -3
  71. package/dist/tools/skillTool.js +2 -2
  72. package/dist/tools/todoWriteTool.d.ts.map +1 -1
  73. package/dist/tools/todoWriteTool.js +23 -0
  74. package/dist/tools/types.d.ts +11 -8
  75. package/dist/tools/types.d.ts.map +1 -1
  76. package/dist/tools/writeTool.d.ts.map +1 -1
  77. package/dist/tools/writeTool.js +30 -15
  78. package/dist/types/commands.d.ts +4 -1
  79. package/dist/types/commands.d.ts.map +1 -1
  80. package/dist/types/config.d.ts +4 -0
  81. package/dist/types/config.d.ts.map +1 -1
  82. package/dist/types/configuration.d.ts +69 -0
  83. package/dist/types/configuration.d.ts.map +1 -0
  84. package/dist/types/configuration.js +8 -0
  85. package/dist/types/core.d.ts +45 -0
  86. package/dist/types/core.d.ts.map +1 -1
  87. package/dist/types/environment.d.ts +83 -0
  88. package/dist/types/environment.d.ts.map +1 -0
  89. package/dist/types/environment.js +21 -0
  90. package/dist/types/fileSearch.d.ts +5 -0
  91. package/dist/types/fileSearch.d.ts.map +1 -0
  92. package/dist/types/fileSearch.js +1 -0
  93. package/dist/types/hooks.d.ts +18 -3
  94. package/dist/types/hooks.d.ts.map +1 -1
  95. package/dist/types/hooks.js +8 -8
  96. package/dist/types/index.d.ts +7 -0
  97. package/dist/types/index.d.ts.map +1 -1
  98. package/dist/types/index.js +7 -0
  99. package/dist/types/lsp.d.ts +90 -0
  100. package/dist/types/lsp.d.ts.map +1 -0
  101. package/dist/types/lsp.js +4 -0
  102. package/dist/types/messaging.d.ts +19 -12
  103. package/dist/types/messaging.d.ts.map +1 -1
  104. package/dist/types/permissions.d.ts +35 -0
  105. package/dist/types/permissions.d.ts.map +1 -0
  106. package/dist/types/permissions.js +12 -0
  107. package/dist/types/session.d.ts +15 -0
  108. package/dist/types/session.d.ts.map +1 -0
  109. package/dist/types/session.js +7 -0
  110. package/dist/types/skills.d.ts +1 -0
  111. package/dist/types/skills.d.ts.map +1 -1
  112. package/dist/types/tools.d.ts +35 -0
  113. package/dist/types/tools.d.ts.map +1 -0
  114. package/dist/types/tools.js +4 -0
  115. package/dist/utils/abortUtils.d.ts +34 -0
  116. package/dist/utils/abortUtils.d.ts.map +1 -0
  117. package/dist/utils/abortUtils.js +92 -0
  118. package/dist/utils/bashHistory.d.ts +4 -0
  119. package/dist/utils/bashHistory.d.ts.map +1 -1
  120. package/dist/utils/bashHistory.js +48 -30
  121. package/dist/utils/builtinSubagents.d.ts +7 -0
  122. package/dist/utils/builtinSubagents.d.ts.map +1 -0
  123. package/dist/utils/builtinSubagents.js +65 -0
  124. package/dist/utils/cacheControlUtils.d.ts +96 -0
  125. package/dist/utils/cacheControlUtils.d.ts.map +1 -0
  126. package/dist/utils/cacheControlUtils.js +324 -0
  127. package/dist/utils/commandPathResolver.d.ts +52 -0
  128. package/dist/utils/commandPathResolver.d.ts.map +1 -0
  129. package/dist/utils/commandPathResolver.js +145 -0
  130. package/dist/utils/configPaths.d.ts +85 -0
  131. package/dist/utils/configPaths.d.ts.map +1 -0
  132. package/dist/utils/configPaths.js +121 -0
  133. package/dist/utils/constants.d.ts +1 -13
  134. package/dist/utils/constants.d.ts.map +1 -1
  135. package/dist/utils/constants.js +2 -14
  136. package/dist/utils/convertMessagesForAPI.d.ts +2 -1
  137. package/dist/utils/convertMessagesForAPI.d.ts.map +1 -1
  138. package/dist/utils/convertMessagesForAPI.js +39 -18
  139. package/dist/utils/customCommands.d.ts.map +1 -1
  140. package/dist/utils/customCommands.js +66 -21
  141. package/dist/utils/fileSearch.d.ts +14 -0
  142. package/dist/utils/fileSearch.d.ts.map +1 -0
  143. package/dist/utils/fileSearch.js +88 -0
  144. package/dist/utils/fileUtils.d.ts +27 -0
  145. package/dist/utils/fileUtils.d.ts.map +1 -0
  146. package/dist/utils/fileUtils.js +145 -0
  147. package/dist/utils/globalLogger.d.ts +88 -0
  148. package/dist/utils/globalLogger.d.ts.map +1 -0
  149. package/dist/utils/globalLogger.js +120 -0
  150. package/dist/utils/largeOutputHandler.d.ts +15 -0
  151. package/dist/utils/largeOutputHandler.d.ts.map +1 -0
  152. package/dist/utils/largeOutputHandler.js +40 -0
  153. package/dist/utils/markdownParser.d.ts.map +1 -1
  154. package/dist/utils/markdownParser.js +1 -17
  155. package/dist/utils/mcpUtils.d.ts.map +1 -1
  156. package/dist/utils/mcpUtils.js +25 -3
  157. package/dist/utils/messageOperations.d.ts +20 -18
  158. package/dist/utils/messageOperations.d.ts.map +1 -1
  159. package/dist/utils/messageOperations.js +30 -38
  160. package/dist/utils/pathEncoder.d.ts +108 -0
  161. package/dist/utils/pathEncoder.d.ts.map +1 -0
  162. package/dist/utils/pathEncoder.js +279 -0
  163. package/dist/utils/subagentParser.d.ts +2 -2
  164. package/dist/utils/subagentParser.d.ts.map +1 -1
  165. package/dist/utils/subagentParser.js +12 -8
  166. package/dist/utils/tokenCalculation.d.ts +26 -0
  167. package/dist/utils/tokenCalculation.d.ts.map +1 -0
  168. package/dist/utils/tokenCalculation.js +36 -0
  169. package/dist/utils/tokenEstimator.d.ts +39 -0
  170. package/dist/utils/tokenEstimator.d.ts.map +1 -0
  171. package/dist/utils/tokenEstimator.js +55 -0
  172. package/package.json +6 -6
  173. package/src/agent.ts +586 -78
  174. package/src/index.ts +4 -0
  175. package/src/managers/aiManager.ts +341 -192
  176. package/src/managers/backgroundBashManager.ts +11 -9
  177. package/src/managers/hookManager.ts +102 -54
  178. package/src/managers/liveConfigManager.ts +634 -0
  179. package/src/managers/lspManager.ts +434 -0
  180. package/src/managers/messageManager.ts +258 -121
  181. package/src/managers/permissionManager.ts +276 -0
  182. package/src/managers/skillManager.ts +3 -1
  183. package/src/managers/slashCommandManager.ts +5 -3
  184. package/src/managers/subagentManager.ts +295 -76
  185. package/src/managers/toolManager.ts +95 -3
  186. package/src/services/aiService.ts +656 -84
  187. package/src/services/configurationService.ts +762 -0
  188. package/src/services/fileWatcher.ts +300 -0
  189. package/src/services/hook.ts +54 -144
  190. package/src/services/jsonlHandler.ts +303 -0
  191. package/src/services/memory.ts +34 -11
  192. package/src/services/session.ts +522 -173
  193. package/src/tools/bashTool.ts +94 -20
  194. package/src/tools/deleteFileTool.ts +38 -1
  195. package/src/tools/editTool.ts +44 -9
  196. package/src/tools/lspTool.ts +760 -0
  197. package/src/tools/multiEditTool.ts +41 -11
  198. package/src/tools/readTool.ts +127 -3
  199. package/src/tools/skillTool.ts +2 -2
  200. package/src/tools/todoWriteTool.ts +33 -1
  201. package/src/tools/types.ts +15 -9
  202. package/src/tools/writeTool.ts +43 -16
  203. package/src/types/commands.ts +6 -1
  204. package/src/types/config.ts +5 -0
  205. package/src/types/configuration.ts +73 -0
  206. package/src/types/core.ts +55 -0
  207. package/src/types/environment.ts +104 -0
  208. package/src/types/fileSearch.ts +4 -0
  209. package/src/types/hooks.ts +32 -16
  210. package/src/types/index.ts +7 -0
  211. package/src/types/lsp.ts +96 -0
  212. package/src/types/messaging.ts +21 -14
  213. package/src/types/permissions.ts +48 -0
  214. package/src/types/session.ts +20 -0
  215. package/src/types/skills.ts +1 -0
  216. package/src/types/tools.ts +38 -0
  217. package/src/utils/abortUtils.ts +118 -0
  218. package/src/utils/bashHistory.ts +55 -31
  219. package/src/utils/builtinSubagents.ts +71 -0
  220. package/src/utils/cacheControlUtils.ts +475 -0
  221. package/src/utils/commandPathResolver.ts +189 -0
  222. package/src/utils/configPaths.ts +163 -0
  223. package/src/utils/constants.ts +2 -17
  224. package/src/utils/convertMessagesForAPI.ts +44 -18
  225. package/src/utils/customCommands.ts +90 -22
  226. package/src/utils/fileSearch.ts +107 -0
  227. package/src/utils/fileUtils.ts +160 -0
  228. package/src/utils/globalLogger.ts +128 -0
  229. package/src/utils/largeOutputHandler.ts +55 -0
  230. package/src/utils/markdownParser.ts +1 -19
  231. package/src/utils/mcpUtils.ts +34 -3
  232. package/src/utils/messageOperations.ts +47 -53
  233. package/src/utils/pathEncoder.ts +394 -0
  234. package/src/utils/subagentParser.ts +13 -9
  235. package/src/utils/tokenCalculation.ts +43 -0
  236. package/src/utils/tokenEstimator.ts +68 -0
  237. package/dist/utils/configResolver.d.ts +0 -38
  238. package/dist/utils/configResolver.d.ts.map +0 -1
  239. package/dist/utils/configResolver.js +0 -106
  240. package/src/utils/configResolver.ts +0 -142
@@ -5,6 +5,7 @@
5
5
 
6
6
  import fs from "fs";
7
7
  import { BASH_HISTORY_FILE, DATA_DIRECTORY } from "./constants.js";
8
+ import { logger } from "./globalLogger.js";
8
9
 
9
10
  export interface BashHistoryEntry {
10
11
  command: string;
@@ -28,8 +29,8 @@ const ensureDataDirectory = (): void => {
28
29
  if (!fs.existsSync(DATA_DIRECTORY)) {
29
30
  fs.mkdirSync(DATA_DIRECTORY, { recursive: true });
30
31
  }
31
- } catch {
32
- // logger.debug("Failed to create data directory:", error);
32
+ } catch (error) {
33
+ logger.debug("Failed to create data directory:", error);
33
34
  }
34
35
  };
35
36
 
@@ -52,7 +53,7 @@ export const loadBashHistory = (): BashHistory => {
52
53
 
53
54
  // Version compatibility check
54
55
  if (history.version !== HISTORY_VERSION) {
55
- // logger.debug("Bash history version mismatch, resetting history");
56
+ logger.debug("Bash history version mismatch, resetting history");
56
57
  return {
57
58
  commands: [],
58
59
  version: HISTORY_VERSION,
@@ -60,8 +61,8 @@ export const loadBashHistory = (): BashHistory => {
60
61
  }
61
62
 
62
63
  return history;
63
- } catch {
64
- // logger.debug("Failed to load bash history:", error);
64
+ } catch (error) {
65
+ logger.debug("Failed to load bash history:", error);
65
66
  return {
66
67
  commands: [],
67
68
  version: HISTORY_VERSION,
@@ -76,7 +77,7 @@ export const saveBashHistory = (history: BashHistory): void => {
76
77
  try {
77
78
  // Skip saving to file when in test environment
78
79
  if (process.env.NODE_ENV === "test") {
79
- // logger.debug("Skipping bash history save in test environment");
80
+ logger.debug("Skipping bash history save in test environment");
80
81
  return;
81
82
  }
82
83
 
@@ -89,8 +90,8 @@ export const saveBashHistory = (history: BashHistory): void => {
89
90
 
90
91
  const data = JSON.stringify(history, null, 2);
91
92
  fs.writeFileSync(BASH_HISTORY_FILE, data, "utf-8");
92
- } catch {
93
- // logger.debug("Failed to save bash history:", error);
93
+ } catch (error) {
94
+ logger.debug("Failed to save bash history:", error);
94
95
  }
95
96
  };
96
97
 
@@ -102,12 +103,6 @@ export const addBashCommandToHistory = (
102
103
  workdir: string,
103
104
  ): void => {
104
105
  try {
105
- // Filter system-generated commands, do not add to history
106
- if (command.startsWith("git add . && git commit -m")) {
107
- // logger.debug("Skipping system-generated command:", { command, workdir });
108
- return;
109
- }
110
-
111
106
  const history = loadBashHistory();
112
107
  const timestamp = Date.now();
113
108
 
@@ -130,9 +125,9 @@ export const addBashCommandToHistory = (
130
125
  }
131
126
 
132
127
  saveBashHistory(history);
133
- // logger.debug("Added bash command to history:", { command, workdir });
134
- } catch {
135
- // logger.debug("Failed to add bash command to history:", error);
128
+ logger.debug("Added bash command to history:", { command, workdir });
129
+ } catch (error) {
130
+ logger.debug("Failed to add bash command to history:", error);
136
131
  }
137
132
  };
138
133
 
@@ -158,7 +153,7 @@ export const searchBashHistory = (
158
153
  if (!normalizedQuery) {
159
154
  // If no search query, return recent commands (deduplicated)
160
155
  const deduped = deduplicateCommands(filteredCommands);
161
- return deduped.slice(-limit).reverse(); // Latest first
156
+ return deduped.slice(0, limit); // Latest first
162
157
  }
163
158
 
164
159
  // Search by relevance
@@ -201,11 +196,16 @@ export const searchBashHistory = (
201
196
  const dedupedMatches = deduplicateCommands(matches);
202
197
  const result = dedupedMatches.slice(0, limit);
203
198
 
204
- // logger.debug("Bash history search results:", { query, workdir: process.cwd(), originalCount: matches.length, dedupedCount: result.length });
199
+ logger.debug("Bash history search results:", {
200
+ query,
201
+ workdir: process.cwd(),
202
+ originalCount: matches.length,
203
+ dedupedCount: result.length,
204
+ });
205
205
 
206
206
  return result;
207
- } catch {
208
- // logger.debug("Failed to search bash history:", error);
207
+ } catch (error) {
208
+ logger.debug("Failed to search bash history:", error);
209
209
  return [];
210
210
  }
211
211
  };
@@ -226,9 +226,9 @@ const deduplicateCommands = (
226
226
  }
227
227
  }
228
228
 
229
- // Sort by timestamp and return
229
+ // Sort by timestamp and return (new to old)
230
230
  return Array.from(commandMap.values()).sort(
231
- (a, b) => a.timestamp - b.timestamp,
231
+ (a, b) => b.timestamp - a.timestamp,
232
232
  );
233
233
  };
234
234
 
@@ -247,13 +247,37 @@ export const getRecentBashCommands = (
247
247
 
248
248
  // Return recent commands after deduplication
249
249
  const deduped = deduplicateCommands(filtered);
250
- return deduped.slice(-limit).reverse(); // Latest first
251
- } catch {
252
- // logger.debug("Failed to get recent bash commands:", error);
250
+ return deduped.slice(0, limit); // Latest first
251
+ } catch (error) {
252
+ logger.debug("Failed to get recent bash commands:", error);
253
253
  return [];
254
254
  }
255
255
  };
256
256
 
257
+ /**
258
+ * Delete a specific command from bash history
259
+ */
260
+ export const deleteBashCommandFromHistory = (
261
+ command: string,
262
+ workdir: string,
263
+ ): void => {
264
+ try {
265
+ const history = loadBashHistory();
266
+ const initialLength = history.commands.length;
267
+
268
+ history.commands = history.commands.filter(
269
+ (entry) => !(entry.command === command && entry.workdir === workdir),
270
+ );
271
+
272
+ if (history.commands.length !== initialLength) {
273
+ saveBashHistory(history);
274
+ logger.debug("Deleted bash command from history:", { command, workdir });
275
+ }
276
+ } catch (error) {
277
+ logger.debug("Failed to delete bash command from history:", error);
278
+ }
279
+ };
280
+
257
281
  /**
258
282
  * Clear bash history
259
283
  */
@@ -264,9 +288,9 @@ export const clearBashHistory = (): void => {
264
288
  version: HISTORY_VERSION,
265
289
  };
266
290
  saveBashHistory(history);
267
- // logger.debug("Bash history cleared");
268
- } catch {
269
- // logger.debug("Failed to clear bash history:", error);
291
+ logger.debug("Bash history cleared");
292
+ } catch (error) {
293
+ logger.debug("Failed to clear bash history:", error);
270
294
  }
271
295
  };
272
296
 
@@ -292,8 +316,8 @@ export const getBashCommandStats = (): {
292
316
  uniqueCommands: uniqueCommands.size,
293
317
  workdirs,
294
318
  };
295
- } catch {
296
- // logger.debug("Failed to get bash command stats:", error);
319
+ } catch (error) {
320
+ logger.debug("Failed to get bash command stats:", error);
297
321
  return {
298
322
  totalCommands: 0,
299
323
  uniqueCommands: 0,
@@ -0,0 +1,71 @@
1
+ import type { SubagentConfiguration } from "./subagentParser.js";
2
+
3
+ /**
4
+ * Get all built-in subagent configurations
5
+ * Built-in subagents have priority 3 (lowest) and can be overridden by user/project configs
6
+ */
7
+ export function getBuiltinSubagents(): SubagentConfiguration[] {
8
+ return [
9
+ createExploreSubagent(),
10
+ // Add more built-in subagents here as needed
11
+ ];
12
+ }
13
+
14
+ /**
15
+ * Create the Explore built-in subagent configuration
16
+ * Specialized for codebase exploration and file search tasks
17
+ */
18
+ function createExploreSubagent(): SubagentConfiguration {
19
+ const systemPrompt = `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
20
+
21
+ === CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
22
+ This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
23
+ - Creating new files (no Write, touch, or file creation of any kind)
24
+ - Modifying existing files (no Edit operations)
25
+ - Deleting files (no rm or deletion)
26
+ - Moving or copying files (no mv or cp)
27
+ - Creating temporary files anywhere, including /tmp
28
+ - Using redirect operators (>, >>, |) or heredocs to write to files
29
+ - Running ANY commands that change system state
30
+
31
+ Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.
32
+
33
+ Your strengths:
34
+ - Rapidly finding files using glob patterns
35
+ - Searching code and text with powerful regex patterns
36
+ - Reading and analyzing file contents
37
+ - Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)
38
+
39
+ Guidelines:
40
+ - Use Glob for broad file pattern matching
41
+ - Use Grep for searching file contents with regex
42
+ - Use Read when you know the specific file path you need to read
43
+ - Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.
44
+ - Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)
45
+ - NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
46
+ - Adapt your search approach based on the thoroughness level specified by the caller
47
+ - Return file paths as absolute paths in your final response
48
+ - For clear communication, avoid using emojis
49
+ - Communicate your final report directly as a regular message - do NOT attempt to create files
50
+
51
+ NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
52
+ - Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
53
+ - Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
54
+
55
+ Complete the user's search request efficiently and report your findings clearly.`;
56
+
57
+ // Define allowed tools for read-only operations
58
+ const allowedTools = ["Glob", "Grep", "Read", "Bash", "LS", "LSP"];
59
+
60
+ return {
61
+ name: "Explore",
62
+ description:
63
+ 'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.',
64
+ systemPrompt,
65
+ tools: allowedTools,
66
+ model: "fastModel", // Special value that will use parent's fastModel
67
+ filePath: "<builtin:Explore>",
68
+ scope: "builtin",
69
+ priority: 3, // Lowest priority - can be overridden by user configs
70
+ };
71
+ }