sapper-iq 1.1.7 → 1.1.8
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 +15 -2
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -353,10 +353,23 @@ IMPORTANT RULES:
|
|
|
353
353
|
// 3. Rebuild the messages array starting with the ORIGINAL prompt
|
|
354
354
|
messages = [originalSystemPrompt, ...recentMessages];
|
|
355
355
|
|
|
356
|
-
// 4.
|
|
356
|
+
// 4. Add reminder to stay in Agent Mode (not chatbot mode)
|
|
357
|
+
messages.push({
|
|
358
|
+
role: 'system',
|
|
359
|
+
content: `CONTEXT PRUNED. REMINDER: You are an AGENT, not a chatbot. You MUST use tools to take action:
|
|
360
|
+
- [TOOL:LIST]path[/TOOL] - List directory
|
|
361
|
+
- [TOOL:READ]path[/TOOL] - Read file
|
|
362
|
+
- [TOOL:SEARCH]pattern[/TOOL] - Search codebase
|
|
363
|
+
- [TOOL:WRITE]path]content[/TOOL] - Create/overwrite file
|
|
364
|
+
- [TOOL:PATCH]path]old|||new[/TOOL] - Edit file
|
|
365
|
+
- [TOOL:SHELL]command[/TOOL] - Run terminal command
|
|
366
|
+
Do NOT just display content. Actually WRITE files using the tool.`
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
// 5. Save to context file so it persists
|
|
357
370
|
fs.writeFileSync(CONTEXT_FILE, JSON.stringify(messages));
|
|
358
371
|
|
|
359
|
-
console.log(chalk.green(`✅ Pruned context.
|
|
372
|
+
console.log(chalk.green(`✅ Pruned context. Sapper reminded to stay in Agent Mode.`));
|
|
360
373
|
console.log(chalk.gray(`Context size: ${messages.length} messages\n`));
|
|
361
374
|
continue;
|
|
362
375
|
}
|