sparkecoder 0.1.54 → 0.1.56
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/agent/index.d.ts +2 -2
- package/dist/agent/index.js +50 -22
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +50 -22
- package/dist/cli.js.map +1 -1
- package/dist/{index-BYOHniN4.d.ts → index-CqKMYoJv.d.ts} +5 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +50 -22
- package/dist/index.js.map +1 -1
- package/dist/{search-DALwmPRX.d.ts → search-CZsTAZ90.d.ts} +6 -6
- package/dist/server/index.js +50 -22
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +36 -21
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/embed/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/embed/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_c9e3cd7b._.js → 2374f_05c00b91._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_de035f79._.js → 2374f_1fa4a79a._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_273991ba._.js → 2374f_39f76acc._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_8d018190._.js → 2374f_562d2f4f._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_7b421f78._.js → 2374f_6ced4caf._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_ec997752._.js → 2374f_800db4e3._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_2572135b._.js → 2374f_934cb548._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_5ee28d4c._.js → 2374f_aade2a6d._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_460c0d78._.js → 2374f_ac284eb3._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_a7457131._.js → 2374f_c272cbb4._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_06a5ea48._.js → 2374f_d118a207._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_df3c414e._.js → 2374f_e35df3d7._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_88cbeb7b._.js → 2374f_ef435bac._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_65b86b54._.js → 2374f_f661d73d._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__a87e1c27._.js → [root-of-the-server]__8cdc7b0b._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__c94aac98._.js → [root-of-the-server]__f44222d9._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{web_b85931da._.js → web_0a13adb9._.js} +2 -2
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/web/.next/static/chunks/{9b4c4424a720586b.js → ca717ddd7c8f37e8.js} +2 -2
- package/web/.next/standalone/web/.next/static/static/chunks/{9b4c4424a720586b.js → ca717ddd7c8f37e8.js} +2 -2
- package/web/.next/standalone/web/src/components/ai-elements/search-tool.tsx +7 -9
- package/web/.next/static/chunks/{9b4c4424a720586b.js → ca717ddd7c8f37e8.js} +2 -2
- /package/web/.next/standalone/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → static/yfBGAcI8gI55lwQllPu-z}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → static/yfBGAcI8gI55lwQllPu-z}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → static/yfBGAcI8gI55lwQllPu-z}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{static/7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{static/7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{static/7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_ssgManifest.js +0 -0
- /package/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_buildManifest.js +0 -0
- /package/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{7rKMR1VNC_1_vH6S9H5aS → yfBGAcI8gI55lwQllPu-z}/_ssgManifest.js +0 -0
|
@@ -13,12 +13,12 @@ interface BashToolOptions {
|
|
|
13
13
|
}
|
|
14
14
|
declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
15
15
|
background: boolean;
|
|
16
|
+
input?: string | undefined;
|
|
16
17
|
id?: string | undefined;
|
|
17
18
|
command?: string | undefined;
|
|
18
19
|
kill?: boolean | undefined;
|
|
19
20
|
tail?: number | undefined;
|
|
20
|
-
|
|
21
|
-
key?: "Enter" | "Escape" | "Up" | "Down" | "Left" | "Right" | "Tab" | "C-c" | "C-d" | "y" | "n" | undefined;
|
|
21
|
+
key?: "y" | "Enter" | "Escape" | "Up" | "Down" | "Left" | "Right" | "Tab" | "C-c" | "C-d" | "n" | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
success: boolean;
|
|
24
24
|
id: string;
|
|
@@ -39,7 +39,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
39
39
|
success: boolean;
|
|
40
40
|
id: string;
|
|
41
41
|
output: string;
|
|
42
|
-
status: "
|
|
42
|
+
status: "unknown" | "running" | "stopped";
|
|
43
43
|
message: string;
|
|
44
44
|
error?: undefined;
|
|
45
45
|
exitCode?: undefined;
|
|
@@ -47,7 +47,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
47
47
|
success: boolean;
|
|
48
48
|
id: string;
|
|
49
49
|
output: string;
|
|
50
|
-
status: "
|
|
50
|
+
status: "unknown" | "running" | "stopped";
|
|
51
51
|
message?: undefined;
|
|
52
52
|
error?: undefined;
|
|
53
53
|
exitCode?: undefined;
|
|
@@ -64,7 +64,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
64
64
|
id: string;
|
|
65
65
|
output: string;
|
|
66
66
|
exitCode: number;
|
|
67
|
-
status: "
|
|
67
|
+
status: "error" | "completed" | "running" | "stopped";
|
|
68
68
|
message?: undefined;
|
|
69
69
|
error?: undefined;
|
|
70
70
|
} | {
|
|
@@ -215,8 +215,8 @@ interface SearchToolOptions {
|
|
|
215
215
|
* Progress is streamed back to the UI so users can see exploration happening.
|
|
216
216
|
*/
|
|
217
217
|
declare function createSearchTool(options: SearchToolOptions): ai.Tool<{
|
|
218
|
+
context: string;
|
|
218
219
|
query: string;
|
|
219
|
-
context?: string | undefined;
|
|
220
220
|
}, {
|
|
221
221
|
success: boolean;
|
|
222
222
|
error: string;
|
package/dist/server/index.js
CHANGED
|
@@ -3830,41 +3830,60 @@ var SearchSubagent = class extends Subagent {
|
|
|
3830
3830
|
this.maxSteps = 10;
|
|
3831
3831
|
}
|
|
3832
3832
|
getSystemPrompt(options) {
|
|
3833
|
-
|
|
3833
|
+
const contextBlock = options.additionalContext ? `
|
|
3834
|
+
## Active Context (from devtools)
|
|
3835
|
+
${options.additionalContext}
|
|
3834
3836
|
|
|
3835
|
-
|
|
3837
|
+
Use this context to understand what the user is currently looking at. If they reference "this page", "this component", "this screen", etc., this context tells you which page/route they mean. Search for files related to this page/route first.
|
|
3838
|
+
` : "";
|
|
3839
|
+
return `You are an Explore agent - a READ-ONLY file search and code analysis specialist. Your job is to find relevant files, understand code structure, and return clear findings to the main agent. You MUST NOT create, modify, or delete any files.
|
|
3836
3840
|
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
-
|
|
3841
|
-
-
|
|
3842
|
-
-
|
|
3841
|
+
Working Directory: ${options.workingDirectory}
|
|
3842
|
+
${contextBlock}
|
|
3843
|
+
## Available Tools
|
|
3844
|
+
- **semantic_search**: Search the codebase by meaning (finds code related to a concept). Use this FIRST when available - it's the fastest way to explore.
|
|
3845
|
+
- **grep**: Search for exact patterns in files using ripgrep. Best for exact symbol/string matches.
|
|
3846
|
+
- **glob**: Find files matching a name pattern. Best for file discovery.
|
|
3847
|
+
- **read_file**: Read contents of a specific file. Use to examine code found in searches.
|
|
3848
|
+
- **list_dir**: List directory contents. Use to understand project structure.
|
|
3843
3849
|
|
|
3844
|
-
## Strategy
|
|
3850
|
+
## Search Strategy
|
|
3845
3851
|
|
|
3846
3852
|
1. **Start with semantic_search** if available - it finds code by meaning, which is the fastest way to explore
|
|
3847
|
-
2. Use grep for exact
|
|
3848
|
-
3.
|
|
3849
|
-
4.
|
|
3853
|
+
2. **Use grep** for exact symbol/string matches (function names, class names, imports)
|
|
3854
|
+
3. **Use glob** for file discovery by name patterns
|
|
3855
|
+
4. **Read key files** to get actual code content and understand context
|
|
3856
|
+
5. **Run searches in PARALLEL** - make multiple tool calls at once to cover different angles simultaneously. This is critical for speed.
|
|
3857
|
+
|
|
3858
|
+
### Tool Selection Guide
|
|
3859
|
+
- Know the exact name? Use **grep** (e.g. \`getUserById\`, \`class AuthService\`)
|
|
3860
|
+
- Exploring a concept? Use **semantic_search** (e.g. "how does authentication work")
|
|
3861
|
+
- Looking for files? Use **glob** (e.g. \`**/*.config.ts\`, \`**/auth/**\`)
|
|
3862
|
+
- Need file content? Use **read_file** with optional line ranges for large files
|
|
3850
3863
|
|
|
3851
3864
|
## CRITICAL: Your text output IS the result
|
|
3852
3865
|
|
|
3853
|
-
The text you write in your responses is what gets sent back to the main agent as the summary. You MUST include:
|
|
3866
|
+
The text you write in your responses is what gets sent back to the main agent as the summary. The main agent has NO other context about what you found. You MUST include:
|
|
3854
3867
|
- **Exact file paths** (relative to working directory)
|
|
3855
3868
|
- **Line numbers** where relevant code is found
|
|
3856
3869
|
- **Key code snippets** showing the important parts
|
|
3857
|
-
- **How pieces connect together**
|
|
3870
|
+
- **How pieces connect together** - explain relationships between files
|
|
3858
3871
|
- **What you actually found**, not just metadata
|
|
3859
3872
|
|
|
3860
3873
|
ALWAYS end with a comprehensive summary of your findings. This summary IS the data that the main agent receives.
|
|
3861
3874
|
|
|
3875
|
+
## Constraints
|
|
3876
|
+
- You are READ-ONLY. Do NOT attempt to create, write, edit, or delete files.
|
|
3877
|
+
- Be fast. Return results quickly. Don't over-explore when you've found what's needed.
|
|
3878
|
+
- Be thorough but efficient. If you find the answer in 2 searches, stop there.
|
|
3879
|
+
- No emojis in output.
|
|
3880
|
+
|
|
3862
3881
|
## Example good output:
|
|
3863
3882
|
"Found the authentication system in src/auth/:
|
|
3864
3883
|
- \`src/auth/provider.ts\` (lines 15-45): AuthProvider class handles JWT token validation
|
|
3865
3884
|
- \`src/auth/middleware.ts\` (lines 8-20): Express middleware that checks auth headers
|
|
3866
3885
|
- \`src/auth/hooks.ts\`: useAuth() hook used by React components
|
|
3867
|
-
The auth flow: middleware validates JWT
|
|
3886
|
+
The auth flow: middleware validates JWT -> provider decodes token -> user context set"
|
|
3868
3887
|
|
|
3869
3888
|
## Example bad output:
|
|
3870
3889
|
"I searched for auth and found some files." (too vague, no paths, no details)
|
|
@@ -4180,14 +4199,10 @@ The Explore agent will explore the codebase and return a summary of findings.
|
|
|
4180
4199
|
This is more thorough than a simple grep because it can follow references and understand context.
|
|
4181
4200
|
It also has access to semantic search to find code by meaning, not just text.
|
|
4182
4201
|
|
|
4183
|
-
|
|
4184
|
-
- "Find all React components that use the useState hook"
|
|
4185
|
-
- "Where is the authentication logic implemented?"
|
|
4186
|
-
- "Find all API routes and their handlers"
|
|
4187
|
-
- "Search for usages of the UserService class"`,
|
|
4202
|
+
CRITICAL: The explore agent has ZERO context. It cannot see the conversation, the user's message, devtools data, or any prior context. You MUST pass ALL relevant context via the "context" parameter. If the user selected a component (component name, file path, HTML, component stack) or there is a <devtools-context> block, you MUST copy that information into the "context" field verbatim. Without it the explore agent is searching blind.`,
|
|
4188
4203
|
inputSchema: z10.object({
|
|
4189
4204
|
query: z10.string().describe("What to search for. Be specific about what you're looking for."),
|
|
4190
|
-
context: z10.string().
|
|
4205
|
+
context: z10.string().describe("ALL context the explore agent needs. It has ZERO context on its own - no conversation history, no devtools data, nothing. You MUST include: any selected component info (name, file path, HTML, component stack), any <devtools-context> block (page URL, path, viewport), and any other relevant details from the user message. The explore agent literally only sees the query and this context field.")
|
|
4191
4206
|
}),
|
|
4192
4207
|
execute: async ({ query, context }, toolOptions) => {
|
|
4193
4208
|
const toolCallId = toolOptions.toolCallId || `explore_agent_${Date.now()}`;
|
|
@@ -4515,6 +4530,11 @@ Use this proactively after making code changes to catch errors early.
|
|
|
4515
4530
|
|
|
4516
4531
|
**Choose the right search approach:**
|
|
4517
4532
|
|
|
4533
|
+
0. **Use paths to your advantage \u2014 skip searching if you already have what you need.**
|
|
4534
|
+
- If the user selected a component via devtools and you can see the component name, file path, and/or line number, you ALREADY know where the code is. Just use \`read_file\` to read that file directly \u2014 do NOT call \`explore_agent\` to "find" something you already have the location of.
|
|
4535
|
+
- If you received a **page path** (e.g. \`/dashboard\`, \`/settings/profile\`), map it to the corresponding file in the project structure. In Next.js this means \`app/dashboard/page.tsx\`, \`app/settings/profile/page.tsx\`, etc. In other frameworks, check the routing convention (e.g. \`pages/\`, \`src/routes/\`). Use \`read_file\` on the mapped path directly.
|
|
4536
|
+
- If the file path doesn't exist or \`read_file\` fails, fall back to grep to locate it (e.g. \`rg "ComponentName" --type ts -l\`) since devtools paths can sometimes be slightly off or truncated.
|
|
4537
|
+
- Read up and down component trees when you have the file path or page path to find what you're looking for.
|
|
4518
4538
|
1. **Use the \`explore_agent\` tool (Explore agent)** for:
|
|
4519
4539
|
- Semantic/exploratory questions: "How does authentication work?", "Where is user data processed?"
|
|
4520
4540
|
- Finding code by meaning or concept, not exact text
|
|
@@ -4524,6 +4544,13 @@ Use this proactively after making code changes to catch errors early.
|
|
|
4524
4544
|
|
|
4525
4545
|
The Explore agent is a mini-agent that intelligently explores the codebase, reads relevant files, and returns a summary of what it found. It's best for understanding and discovery.
|
|
4526
4546
|
|
|
4547
|
+
**MANDATORY \u2014 The Explore agent has ZERO context.** It cannot see the conversation, the user's messages, devtools data, or anything else. The \`query\` and \`context\` fields are the ONLY information it receives. Every time you call \`explore_agent\`, you MUST populate the \`context\` field with ALL relevant information:
|
|
4548
|
+
- Copy the ENTIRE \`<devtools-context>\` block (page URL, path, viewport) if one exists in the user's message.
|
|
4549
|
+
- Copy ALL selected component info (component name, file path, line number, HTML snippet, component stack) if the user selected something via devtools.
|
|
4550
|
+
- Include any file paths, component names, or page names the user mentioned.
|
|
4551
|
+
- If you skip the \`context\` field, the explore agent is searching completely blind and will waste time guessing.
|
|
4552
|
+
- NEVER call \`explore_agent\` with only a \`query\` and no \`context\` when the user's message contains devtools or component information.
|
|
4553
|
+
|
|
4527
4554
|
2. **Use direct commands (grep/rg, find)** for:
|
|
4528
4555
|
- Exact string matches: \`rg "functionName"\`, \`rg "class MyClass"\`
|
|
4529
4556
|
- Finding files by name: \`find . -name "*.config.ts"\`
|
|
@@ -4531,7 +4558,8 @@ Use this proactively after making code changes to catch errors early.
|
|
|
4531
4558
|
- Counting occurrences or listing all matches
|
|
4532
4559
|
|
|
4533
4560
|
**Examples:**
|
|
4534
|
-
-
|
|
4561
|
+
- User selected \`<LandingButton>\` at \`src/components/LandingButton.tsx:12\` \u2192 Just \`read_file("src/components/LandingButton.tsx")\`. Do NOT call explore_agent.
|
|
4562
|
+
- "Where is the API authentication handled?" (no file path given) \u2192 Use \`explore_agent\` tool
|
|
4535
4563
|
- "Find all usages of getUserById" \u2192 Use \`rg "getUserById"\`
|
|
4536
4564
|
- "How does the payment flow work?" \u2192 Use \`explore_agent\` tool
|
|
4537
4565
|
- "Find files named config" \u2192 Use \`find . -name "*config*"\`
|