sapper-iq 1.0.17 → 1.0.18
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/package.json +1 -1
- package/sapper.mjs +21 -12
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -132,29 +132,38 @@ async function runSapper() {
|
|
|
132
132
|
if (messages.length === 0) {
|
|
133
133
|
messages = [{
|
|
134
134
|
role: 'system',
|
|
135
|
-
content: `You are Sapper, a senior engineer
|
|
135
|
+
content: `You are Sapper, a senior engineer.
|
|
136
136
|
|
|
137
137
|
CRITICAL: You are working in the CURRENT DIRECTORY. Always use relative paths!
|
|
138
138
|
- Use . or ./ for current directory
|
|
139
139
|
- NEVER use / (that's the root directory)
|
|
140
140
|
- Use relative paths like ./file.js or subfolder/file.js
|
|
141
141
|
|
|
142
|
-
STRATEGY:
|
|
143
|
-
1.
|
|
144
|
-
2.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
STRATEGY FOR FILE READING:
|
|
143
|
+
1. Start with [TOOL:LIST].[/TOOL] to see what exists
|
|
144
|
+
2. READ FILES BASED ON TASK:
|
|
145
|
+
- Quick overview: Read 2-3 key files (README, package.json, main entry)
|
|
146
|
+
- Deep analysis: Read ALL relevant files (entire src/ folder, all components)
|
|
147
|
+
- User asks "read all": Read ALL files they mention
|
|
148
|
+
3. Use format: [TOOL:TYPE]path]content[/TOOL]
|
|
149
|
+
4. After reading, PROVIDE ANALYSIS - don't just list more!
|
|
150
|
+
|
|
151
|
+
READING GUIDELINES:
|
|
152
|
+
- If user says "analyze src folder" → Read ALL files in src/
|
|
153
|
+
- If user says "read everything" → List directory, then read all files
|
|
154
|
+
- If < 20 files total: Read them all
|
|
155
|
+
- If > 20 files: Ask user which area to focus on OR read all if analyzing entire project
|
|
156
|
+
- If > 50 files: Read key files first, then ask user for focus area
|
|
148
157
|
|
|
149
158
|
TOOL FORMAT (CRITICAL - FOLLOW EXACTLY):
|
|
150
159
|
✅ CORRECT: [TOOL:LIST].[/TOOL]
|
|
151
160
|
✅ CORRECT: [TOOL:READ]./file.js[/TOOL]
|
|
161
|
+
✅ CORRECT: [TOOL:LIST]./src[/TOOL] then read all files found
|
|
152
162
|
❌ WRONG: [TOOL:LIST].[/] - missing TOOL at end!
|
|
153
163
|
❌ WRONG: [TOOL:LIST]/[/TOOL] - wrong directory!
|
|
154
164
|
|
|
155
165
|
WORKFLOW:
|
|
156
|
-
1. LIST directory → 2. READ
|
|
157
|
-
Don't keep executing tools endlessly - provide insights after reading!`
|
|
166
|
+
1. LIST directory → 2. READ files (as many as needed) → 3. ANALYZE and RESPOND`
|
|
158
167
|
}];
|
|
159
168
|
}
|
|
160
169
|
|
|
@@ -212,9 +221,9 @@ Don't keep executing tools endlessly - provide insights after reading!`
|
|
|
212
221
|
}
|
|
213
222
|
fs.writeFileSync(CONTEXT_FILE, JSON.stringify(messages));
|
|
214
223
|
|
|
215
|
-
// Warn if too many
|
|
216
|
-
if (toolMatches.length >
|
|
217
|
-
console.log(chalk.yellow('\n⚠️
|
|
224
|
+
// Warn if reading too many files at once
|
|
225
|
+
if (toolMatches.length > 30) {
|
|
226
|
+
console.log(chalk.yellow('\n⚠️ Reading 30+ files! This might take time. Consider being more selective.'));
|
|
218
227
|
}
|
|
219
228
|
} else {
|
|
220
229
|
// No tools - check for malformed commands
|