sapper-iq 1.1.14 → 1.1.16
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 +5 -12
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -426,9 +426,9 @@ async function runSapper() {
|
|
|
426
426
|
if (messages.length === 0) {
|
|
427
427
|
messages = [{
|
|
428
428
|
role: 'system',
|
|
429
|
-
content: `You are Sapper, a coding assistant
|
|
429
|
+
content: `You are Sapper, a coding assistant.
|
|
430
430
|
|
|
431
|
-
GOLDEN RULE:
|
|
431
|
+
GOLDEN RULE:
|
|
432
432
|
- NEVER add features the user didn't ask for.
|
|
433
433
|
- ALWAYS confirm with the user before writing/patching files or running shell commands.
|
|
434
434
|
- KEEP responses concise and to the point.
|
|
@@ -463,14 +463,7 @@ PATH RULES:
|
|
|
463
463
|
- NEVER use absolute paths like /file.js
|
|
464
464
|
- Use . for current directory
|
|
465
465
|
|
|
466
|
-
|
|
467
|
-
1. Understand exactly what user wants
|
|
468
|
-
2. Use LIST to see existing files if needed
|
|
469
|
-
3. Use READ to check existing code if needed
|
|
470
|
-
4. Use WRITE/PATCH to make changes
|
|
471
|
-
5. Be concise in explanations
|
|
472
|
-
|
|
473
|
-
CRITICAL: Stay focused. If user asks for X, deliver X only.`
|
|
466
|
+
`
|
|
474
467
|
}];
|
|
475
468
|
}
|
|
476
469
|
|
|
@@ -647,8 +640,8 @@ Do NOT just display content. Actually WRITE files using the tool.`
|
|
|
647
640
|
console.log();
|
|
648
641
|
messages.push({ role: 'assistant', content: msg });
|
|
649
642
|
|
|
650
|
-
// Fixed regex:
|
|
651
|
-
const toolMatches = [...msg.matchAll(/\[TOOL:(\w+)\](
|
|
643
|
+
// Fixed regex: [^\]]+ stops at first ] to correctly separate path from content
|
|
644
|
+
const toolMatches = [...msg.matchAll(/\[TOOL:(\w+)\]([^\]]+)(?:\]([\s\S]*?))?\[\/TOOL\]/g)];
|
|
652
645
|
|
|
653
646
|
// Debug mode: show what regex sees
|
|
654
647
|
if (debugMode) {
|